<?php
$_base_route = !empty($_upcoming) ? '/node/upcoming' : '/';
$breadcrumb_html = array();
if (!empty($requested_category)) {
    $requested_category_id = $requested_category->getId();
    $parent_id = $requested_category->getParentId();
    if (!empty($requested_keyword)) {
        $category_title = _('Search: ') . $requested_keyword;
        $breadcrumb_html[] = h($category_title);
        $breadcrumb_html[] = sprintf('<a href="%s">%s</a>', Sabai_URL::get($_base_route, array('category_id' => $requested_category_id)), h($requested_category->getLabel()));
    } else {
        $category_title = $requested_category->getLabel();
        $breadcrumb_html[] = h($category_title);
    }
    while (isset($categories[$parent_id])) {
        $breadcrumb_html[] = sprintf('<a href="%s">%s</a>', Sabai_URL::get($_base_route, array('category_id' => $parent_id)), h($categories[$parent_id]->getLabel()));
        $parent_id = $categories[$parent_id]->getParentId();
    }
} else {
    $requested_category_id = 0;
    if (!empty($requested_keyword)) {
        $category_title = _('Search: ') . $requested_keyword;
        $breadcrumb_html[] = h($category_title);
    } else {
        $category_title = $CONFIG->get('toppageTitle');
    }
}
if (!empty($breadcrumb_html)) {
    krsort($breadcrumb_html);
    $breadcrumb = $this->helper('XiggBreadCrumb', $CONFIG) . implode(' &#8250; ', $breadcrumb_html);
} else {
    $breadcrumb = $this->helper('XiggBreadCrumb', $CONFIG, false);
}
$entity_count_first = $pages->getEntityCount() ? $pages->getPerPage() * ($page->getPageNumber() - 1) + 1 : 0;
$entity_count_last = ($pages->getEntityCount() < $entity_count_now = $pages->getPerPage() * $page->getPageNumber()) ? $pages->getEntityCount() : $entity_count_now;
$node_nav_result = __('Showing %1$d - %2$d of %3$d', array($entity_count_first, $entity_count_last, $pages->getEntityCount()));
?>